package com.huaxin.hxmoduleworkorder.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huaxin.hxmoduleworkorder.dto.ResponseResult;
import com.huaxin.hxmoduleworkorder.dto.response.GetInspectionOrderCustomerRespDTO;
import com.huaxin.hxmoduleworkorder.models.InspectionOrderCustomer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface InspectionOrderCustomerMapper extends BaseMapper<InspectionOrderCustomer> {
    /**
     * 删除巡查工单客户关联
     *
     * @param orderId    工单ID
     * @param customerId 客户ID
     * @return 删除结果
     */
    Boolean delete(@Param("orderId") String orderId, @Param("customerId") String customerId);

    /**
     * 删除工单关联的工单客户
     *
     * @param orderId 工单ID
     * @return 删除结果
     */
    Boolean deleteByOrderId(@Param("orderId") String orderId);

    /**
     * 获取工单客户关联
     *
     * @param orderId 工单ID
     * @return 工单客户关联列表
     */
    Page<GetInspectionOrderCustomerRespDTO> getInspectionOrderCustomer(
            Page<GetInspectionOrderCustomerRespDTO> page,
            @Param("orderId") String orderId
    );
}
